<template>
    <div class="page_w_h list ">
        <ul>
            <li v-for="item in vid_data" @click="playVideo(item)">
                <h1>{{ item.title }}</h1>
                <p>{{ item.text }}</p>
            </li>

        </ul>
    </div>
    <play :src="src" :is-show="showPlay" @close="close"></play>
</template>


<script setup>
import data from '../../assets/data/data'
import { ref } from 'vue';
import play from './vid_play.vue'
let vid_data = ref(data.videos)
let showPlay = ref(false)
let src = ref('')
function playVideo(obj) {
    showPlay.value = true
    src.value = obj.src
}


function close(obj) {
    showPlay.value = obj.show
    src.value = obj.src
}
</script>

<style scoped lang="less">
.list {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: cornflowerblue;
    width: auto;

    ul {
        width: 85%;
        height: 90%;
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
        overflow: auto;

        /* 滚动条整体 */
        &::-webkit-scrollbar {
            height: 20px;
            width: 20;
        }

        /* 两个滚动条交接处 -- x轴和y轴 */
        &::-webkit-scrollbar-corner {
            background-color: transparent;
        }

        /* 滚动条滑块 */
        &::-webkit-scrollbar-thumb {
            border-radius: 5px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #FFB6C1;
        }

        /* 滚动条轨道 */
        &::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            border-radius: 5px;
            background: #ededed;
        }

        li {
            width: 23%;
            min-height: 10%;
            max-height: 20%;
            border: 1px solid #ededed;
            margin-top: 10px;
            cursor: pointer;

            h1 {
                text-align: right;
                margin-right: 20px;
                text-decoration: underline;
            }

            p {
                padding: 0 20px;
            }
        }
    }
}
</style>
